Shader "PBRToon"
{
    Properties
    {	
        
        _MainTex("Base Color Map", 2D) = "white" {}      
        _Color("Color Tint", Color) = (1,1,1,1)
        
        _BumpMap("Normal Map", 2D) = "bump" {}
        
        _MetallicGlossMap("Metallic Map(R:Metallic A:Smoothness)", 2D) = "white" {} //Metallic, 0, 0, Smoothness  
        _Metallic("Metallic", Range(0,1)) = 0
        _Glossiness("Smoothness", Range(0,1)) = 0
        
        _SpecularMap("Specular Map(R:Intensity A:Smoothness)", 2D) = "white" {}
        _SpecularIntensity("Specular Intensity", Float) = 0
        _SpecularArea("Specular Smoothness", Range(0,1)) = 0.5   

        _OcclusionMap("Occlusion", 2D) = "white" {}
        _OcclusionColor("Occlusion Color", Color) = (0,0,0,0)

        _EmissionMap("Emission Map", 2D) = "white" {}
        [HDR]_EmissionColor("Emission Color", Color) = (0,0,0,0)
        
        _RimColor("Rimlight Tint", Color) = (1,1,1,1) 
        _RimIntensity("Rimlight Intensity", Float) = 0
        _RimRange("Rim Range", Range(0,1)) = 0.7
        
        _ShadowSharpness("Received Shadow Sharpness", Range(0,1)) = 0.5
        
        _OutlineWidth("Outline Width", Range(0, 5)) = 1
        [HDR]_OutlineColor("Outline Color", Color) = (0,0,0,1)

        
    }
    
    SubShader
    {
        Tags { "RenderType"="Opaque" "Queue"="Geometry" }
        Cull off
        Stencil 
        {
            Ref [_Stencil]
            Comp [_StencilComp]
            Pass [_StencilOp]
        }
        Pass
        {
            Name "FORWARD"
            Tags { "LightMode" = "ForwardBase" }
            
            CGPROGRAM
            #define Geometry

            #pragma vertex vert
            #pragma geometry geom
            #pragma fragment frag

            #pragma multi_compile _ VERTEXLIGHT_ON
            #pragma multi_compile_fog
            #pragma multi_compile_fwdbase 
            
            #ifndef UNITY_PASS_FORWARDBASE
                #define UNITY_PASS_FORWARDBASE
            #endif

            #include "ToonBase.cginc"
            ENDCG
        }

        Pass
        {
            Name "FWDADD"
            Tags { "LightMode" = "ForwardAdd" }
            Blend One One

            CGPROGRAM
            #define Geometry

            #pragma vertex vert
            #pragma geometry geom
            #pragma fragment frag

            #pragma multi_compile_fog
            #pragma multi_compile_fwdadd_fullshadows
            #ifndef UNITY_PASS_FORWARDADD
                 #define UNITY_PASS_FORWARDADD
            #endif
            
            #include "ToonBase.cginc"
            ENDCG
        }


    }
    Fallback "Diffuse"
    
}